
class Item:

    def __init__(self, name: str, action: str, is_input_required: bool) -> None:
        self.name               = name
        self.action             = action
        self.is_input_required  = is_input_required

    def to_json(self) -> dict[str, str | bool]:
        return {
            'name'              : self.name,
            'action'            : self.action,
            'is_input_required' : self.is_input_required
        }
   
    @staticmethod
    def from_json(js: dict):
        return Item(
            name                = js['name'],
            action              = js['action'],
            is_input_required   = js['is_input_required']
        )

